package com.gitee.wsl.compose.ui.button

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.unit.dp
import com.gitee.wsl.compose.ui.base.Button


val DEFAULT__BUTTON_SIZE = 50.dp
val DEFAULT__BUTTON_SIZE_EXTRA = 60.dp


@Composable
fun Button.Circle(
    modifier : Modifier = Modifier,
    imageVector: ImageVector,
    border: BorderStroke = BorderStroke(1.dp, MaterialTheme.colorScheme.outline),
    onClick: () -> Unit
) {
    Card(
        modifier = modifier.size(50.dp),
        shape = CircleShape,
        elevation = CardDefaults.cardElevation(0.dp),
        border = border,
        onClick = {
            onClick()
        }
    ) {
        Box(
            modifier = Modifier.fillMaxSize(),
            contentAlignment = Alignment.Center
        ) {
            Icon(imageVector, null)
        }
    }
}

